﻿using System;
using System . Collections . Generic;
using System . Linq;
using System . Text;
using System . Xml . Linq;

namespace WenceyWang . RichMan4L . Calendars
{
	public class Calendar : GameObject
	{
		#region Events

		public List<CalendarEvent> EventList { get; private set; } = new List<CalendarEvent> ( );

		public List<CalendarEvent> GetEvents ( GameDate date ) { return new List<CalendarEvent> ( EventList . Where ( ( e ) => e . Date == date ) ); }

		#endregion

		public Dictionary<GameDate , Weathers . Weather> WeatherList { get; private set; }

		#region SeasonLenth

		public long SpringLenth { get; set; }

		public long SummerLenth { get; set; }

		public long AutumnLenth { get; set; }

		public long WinterLenth { get; set; }

		#endregion

		public GameDate Today { get; set; }

		public void PostEvent ( string text )
		{
			EventList . Add ( new CalendarEvent ( text ) );
		}

		public void PostEvent ( string title , string text )
		{
			EventList . Add ( new CalendarEvent ( text , title ) );
		}

		public void PostEvent ( string title , string text , Players . Player gainedPlayer , Players . Player harmedPlayer )
		{
			EventList . Add ( new CalendarEvent ( text , title , gainedPlayer , harmedPlayer ) );
		}


		public Calendar ( ) : base ( )
		{
			Today = new GameDate ( 1 );
		}

		public override void StartDay ( GameDate nextDate )
		{

		}

		public override void EndToday ( )
		{

		}
	}
}
